package com.ahies.base;


import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;
import java.util.Map;

/**
 * CRUD Service 基类
 *
 * @author W
 */

/**
 * code is far away from bug with the animal protecting
 *
 * @Description : service接口 基类
 */
public interface BaseService<T extends BaseEntity> extends IService<T> {

    Page<T> selectPage(Page<T> page, Wrapper<T> queryWrapper);

    Page<Map<String, Object>> selectMapsPage(Page<T> page, Wrapper<T> queryWrapper);

    Integer deleteById(Integer id);

    T selectById(Integer id);

    List<T> getByIds(List<Integer> ids);

    Map<Integer, T> encapsulationMap();

    Map<Integer, T> mapByIds(List<Integer> ids);

    <O extends BaseEntity<O>> Map<Integer, O> listToMap(List<O> list);

    boolean addValidator(String column, String value);

    boolean updateValidator(String column, String value, Integer id);

    List<Integer> getIds(List<T> list);


}